import 'package:flutter/material.dart';
import 'package:flutter_getx/app/const.dart';

import 'package:get/get.dart';

import '../controllers/campus_controller.dart';

class CampusView extends GetView<CampusController> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('校园'),
        centerTitle: true,
      ),
      body: Container(
        color: bgColor,
        child: Column(
            children: controller.list
                .map((e) => GestureDetector(
              onTap: () {
                controller.tapTo(e);
              },
                  child: Container(
                        color: Colors.white,
                        child: ListTile(
                          leading: Image.asset(
                            e['img'],
                            width: 40,
                          ),
                          title: Text(e['title']),
                          trailing: Icon(Icons.arrow_right, color: Colors.grey),
                        ),
                      ),
                ))
                .toList()),
      ),
    );
  }
}
